#include "Task.h"
#include "Result.h"

using namespace util;

Task::Task()
    : res_(nullptr)
{
}

void Task::execute()
{
    if (!res_)
        return;
        
    res_->put(run());
}

void Task::make_result(Result* res)
{
    if (!res)
    {
        res_ = nullptr;
        return;
    }
    res_ = res;
}